<?php

$selected_region_setting = array(
    'table_name' => 'animus_sub_region',
    'key_field' => 'id',
    'value_field' => 'name',
);

if ($parkway->num_rows() > 0) {
    $pw = $parkway->row();
    $selected_region = $pw->region_id;
}

$image_path = './assets/parkway/images/' . $pw->image;
if ($pw->image != '') {
    if (file_exists($image_path)) {
        $image_path = base_url() . '/assets/parkway/images/' . $pw->image;
    } else {
        $image_path = root_url('doggy-flirt') . 'doggy_avatar/noimage.gif';
    }
} else {
    $image_path = root_url('doggy-flirt') . 'assets/noimage.gif';
}
?>

<div id="wrapper-content">
  <table class="titrepage" width="100%">
        <tr>
            <td >Parc</td>
     </tr>
    </table>
    
        <?php echo form_open_multipart(site_url('doggy_admin/edit_parkway') . '/' . $pw->id); ?>
        <table align="center" width="100%" class="list" cellpadding="10px" cellspacing="0">
            <tr>
                <td>Région:</td>
                <td><?php echo form_dropdown('region_id',dropdown_data($selected_region_setting),$selected_region)?></td>
            </tr>
            <tr>
                <td>Nom du parc:</td>
                <td><input name="name" type="text" value="<?php echo $pw->name; ?>" /></td>
            </tr>
            <tr>
                <td>Image</td>
                <td><img src="<?php echo $image_path;?>" height="60"/><input type="file" name="userfile" id="userfile" size="25"/></td>
            </tr>
            <tr>
                <td>Description:</td>
                <td colspan="2">
                    <?php
                    $data = array('name' => 'description',
                        'id' => 'description',
                        'width' => '600',
                        'height' => '250',
                        'value' => $pw->description,
                        'type' =>'text'
                    );
                    echo form_fckeditor($data);
                    ?>
                </td>
            </tr>
            <tr>
                <td></td>
                <td colspan="2"><?php echo form_error('description'); ?></td>
            </tr>
            <tr>
              <td></td>  <td><input type="submit" name="submit" value=" Modifier "/></td>
            </tr>
        </table>

    <?php echo form_close() ?>

</div>

